<?
include_once "JCAT_GtkDialog.class.php" ;

class DlgPackagesBase extends JCAT_GtkDialog
{
	function DlgPackagesBase()
	{
		$this->JCAT_GtkDialog() ;
	}
	
	protected function InitWidget()
	{
		// 初始化窗口
		$this->AddWidgetName('TreePackages','GtkTreeView') ;
		$this->AddWidgetName('BtnNew','GtkButton') ;
		$this->AddWidgetName('BtnModify','GtkButton') ;
		$this->AddWidgetName('BtnDelete','GtkButton') ;
		$this->AddWidgetName('BtnCode','GtkButton') ;
		$this->AddWidgetName('BtnQuit','GtkButton') ;
		
		$this->CreateByGlade('./glades/DlgPackages.template.glade','DlgPackages') ;

		ASSERT( $this->wndTreePackages = $this->GetChildWidget('TreePackages') ) ;
		ASSERT( $this->wndBtnNew = $this->GetChildWidget('BtnNew') ) ;
		ASSERT( $this->wndBtnModify = $this->GetChildWidget('BtnModify') ) ;
		ASSERT( $this->wndBtnDelete = $this->GetChildWidget('BtnDelete') ) ;
		ASSERT( $this->wndBtnCode = $this->GetChildWidget('BtnCode') ) ;
		ASSERT( $this->wndBtnQuit = $this->GetChildWidget('BtnQuit') ) ;
		
		// 连接按钮事件
		$this->wndBtnNew->connect_simple('clicked',array($this,'OnBtnNew')) ;
		$this->wndBtnModify->connect_simple('clicked',array($this,'OnBtnModify')) ;
		$this->wndBtnDelete->connect_simple('clicked',array($this,'OnBtnDelete')) ;
		$this->wndBtnCode->connect_simple('clicked',array($this,'OnBtnCode')) ;
		$this->wndBtnQuit->connect_simple('clicked',array($this,'OnBtnQuit')) ;

		// ... ...
		
		// 视图
		//$this->aModelTreePackages = new GtkTreeStore( JCAT_Gtk_TYPE_STRING, JCAT_Gtk_TYPE_STRING, JCAT_Gtk_TYPE_STRING );
		//$this->wndTreePackages->set_model($this->aModelTreePackages) ;
		//$aRenderer = new GtkCellRendererText();
		//$this->wndTreePackages->append_column(new GtkTreeViewColumn('Column A',$aRenderer, 'text', 0)) ;
		//$this->wndTreePackages->append_column(new GtkTreeViewColumn('Column B',$aRenderer, 'text', 1)) ;
		//$this->wndTreePackages->append_column(new GtkTreeViewColumn('Column C',$aRenderer, 'text', 2)) ;


		// ... ...

	}
	
	// 声明子窗体
	protected $wndTreePackages ;
	protected $wndBtnNew ;
	protected $wndBtnModify ;
	protected $wndBtnDelete ;
	protected $wndBtnCode ;
	protected $wndBtnQuit ;


	// 声明内部数据
	protected $aModelTreePackages ;


	// 数据交换
	public function UpdateData($bUICtr2Var=true)
	{
		if($bUICtr2Var)
		{
			// ... ...
		}
		else
		{
			// ... ...
		}
	}
	
	// 序列化
	public function Serialize(JCAT_Archive $aArchive)
	{
		if($aArchive->IsLoad())
			JCAT_GtkDialog::Serialize($aArchive) ;

		// ... ...
		
		if($aArchive->IsSave())
			JCAT_GtkDialog::Serialize($aArchive) ;
	}
	
	// 定义按钮事件
	public function OnBtnNew()
	{
	}

	public function OnBtnModify()
	{
	}

	public function OnBtnDelete()
	{
	}

	public function OnBtnCode()
	{
	}

	public function OnBtnQuit()
	{
	}



}
?>